﻿IF object_id(N'dbo.TabUsrMailFolder', 'U') IS NULL
BEGIN
    CREATE TABLE [dbo].[TabUsrMailFolder] (
        [FolderID]   numeric(18,0) NOT NULL identity(1, 1),
        [UserID]     numeric(18,0) NOT NULL,
        [FolderName] nvarchar(20)  COLLATE Chinese_PRC_CI_AS NOT NULL,
        [Attribute]  bit           NOT NULL,

        CONSTRAINT [PK_TabUsrMailFolder] PRIMARY KEY CLUSTERED ([FolderID] asc),
        CONSTRAINT [FK_TabUsrMailFolder_TabAccountIndex1] FOREIGN KEY ([UserID]) REFERENCES [dbo].[TabAccountIndex] ([UserID]) ON DELETE CASCADE ON UPDATE CASCADE
    );
END
GO
